﻿using System;
namespace IFramework
{
    public class BoolTransitionCondtion : TransitionCondtion<bool>
    {
        public BoolTransitionCondtion(string condtionName, object defaultVal, TransitionCondtionType condtionType) : base( condtionName, defaultVal, condtionType) { }
        
        public override bool IsMetCondition()
        {
            switch (condtionType)
            {
                case TransitionCondtionType.EqualDefault:
                    return defaultValue != value;
                case TransitionCondtionType.NotEqualDefault:
                    return defaultValue == value;
                case TransitionCondtionType.SmallerThanDefalt:
                case TransitionCondtionType.BiggerThanDefalt:
                default:
                    return false;
            }
        }
        public override void SetTransitionCondtionType(TransitionCondtionType condtionType)
        {
            switch (condtionType)
            {
                case TransitionCondtionType.SmallerThanDefalt:
                case TransitionCondtionType.BiggerThanDefalt:
                    throw new Exception("The Type is Illeagal whith " + ObjType);
                case TransitionCondtionType.EqualDefault:
                case TransitionCondtionType.NotEqualDefault:
                    this.condtionType = condtionType;
                    break;
            }
        }

       
    }
}